<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilpdi: XilPDI APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilpdi
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__xilpdi__apis.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">XilPDI APIs</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gacf4b60f3bfd29d0d200e4f218b74dcdf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#gacf4b60f3bfd29d0d200e4f218b74dcdf">XilPdi_ValidateChecksum</a> (const void *Buffer, u32 Length)</td></tr>
<tr class="memdesc:gacf4b60f3bfd29d0d200e4f218b74dcdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to validate the word checksum for the Image Header table and Partition Headers.  <a href="#gacf4b60f3bfd29d0d200e4f218b74dcdf">More...</a><br/></td></tr>
<tr class="separator:gacf4b60f3bfd29d0d200e4f218b74dcdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga797b37ca16b6096549489adff97e5dfc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga797b37ca16b6096549489adff97e5dfc">XilPdi_ValidateImgHdrTbl</a> (const <a class="el" href="struct_xil_pdi___img_hdr_tbl.html">XilPdi_ImgHdrTbl</a> *ImgHdrTbl)</td></tr>
<tr class="memdesc:ga797b37ca16b6096549489adff97e5dfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function checks the fields of the Image Header Table and validates them.  <a href="#ga797b37ca16b6096549489adff97e5dfc">More...</a><br/></td></tr>
<tr class="separator:ga797b37ca16b6096549489adff97e5dfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga68f9d9d52845d0060f3a12877e54e1cf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga68f9d9d52845d0060f3a12877e54e1cf">XilPdi_ValidatePrtnHdr</a> (const <a class="el" href="struct_xil_pdi___prtn_hdr.html">XilPdi_PrtnHdr</a> *PrtnHdr)</td></tr>
<tr class="memdesc:ga68f9d9d52845d0060f3a12877e54e1cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function validates the Partition Header.  <a href="#ga68f9d9d52845d0060f3a12877e54e1cf">More...</a><br/></td></tr>
<tr class="separator:ga68f9d9d52845d0060f3a12877e54e1cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab95449e9eb9805839f99e2b4aa107313"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#gab95449e9eb9805839f99e2b4aa107313">XilPdi_ReadBootHdr</a> (const <a class="el" href="struct_xil_pdi___boot_hdr.html">XilPdi_BootHdr</a> **BootHdrPtr)</td></tr>
<tr class="memdesc:gab95449e9eb9805839f99e2b4aa107313"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads the boot header.  <a href="#gab95449e9eb9805839f99e2b4aa107313">More...</a><br/></td></tr>
<tr class="separator:gab95449e9eb9805839f99e2b4aa107313"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e8b30c329673e17c9068780d5039b62"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga0e8b30c329673e17c9068780d5039b62">XilPdi_ReadImgHdrTbl</a> (<a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr)</td></tr>
<tr class="memdesc:ga0e8b30c329673e17c9068780d5039b62"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function Reads the Image Header Table.  <a href="#ga0e8b30c329673e17c9068780d5039b62">More...</a><br/></td></tr>
<tr class="separator:ga0e8b30c329673e17c9068780d5039b62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06f73224852f1c65b02cbcfae050385b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga06f73224852f1c65b02cbcfae050385b">XilPdi_ReadIhtAndOptionalData</a> (<a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr, u8 PdiType)</td></tr>
<tr class="memdesc:ga06f73224852f1c65b02cbcfae050385b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads IHT and optional data in Image Header Table.  <a href="#ga06f73224852f1c65b02cbcfae050385b">More...</a><br/></td></tr>
<tr class="separator:ga06f73224852f1c65b02cbcfae050385b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d9a4d9527cebbe53947e863c88cab1e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga3d9a4d9527cebbe53947e863c88cab1e">XilPdi_ReadOptionalData</a> (<a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr, u8 PdiType)</td></tr>
<tr class="memdesc:ga3d9a4d9527cebbe53947e863c88cab1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads optional data in Image Header Table.  <a href="#ga3d9a4d9527cebbe53947e863c88cab1e">More...</a><br/></td></tr>
<tr class="separator:ga3d9a4d9527cebbe53947e863c88cab1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3bac0965e4b613497a5126a4e34feae1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga3bac0965e4b613497a5126a4e34feae1">XilPdi_StoreDigestTable</a> (<a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr)</td></tr>
<tr class="memdesc:ga3bac0965e4b613497a5126a4e34feae1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function stores digest table for given data Id.  <a href="#ga3bac0965e4b613497a5126a4e34feae1">More...</a><br/></td></tr>
<tr class="separator:ga3bac0965e4b613497a5126a4e34feae1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga99aeeb01dc13465959103fa29625923a"><td class="memItemLeft" align="right" valign="top">u64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga99aeeb01dc13465959103fa29625923a">XilPdi_SearchOptionalData</a> (u64 StartAddress, u64 EndAddress, u32 DataId)</td></tr>
<tr class="memdesc:ga99aeeb01dc13465959103fa29625923a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function search offset of optional data address.  <a href="#ga99aeeb01dc13465959103fa29625923a">More...</a><br/></td></tr>
<tr class="separator:ga99aeeb01dc13465959103fa29625923a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab4d2ba6eeeac98dd13665d92c892a5ac"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_xil_pdi___prtn_hash_info.html">XilPdi_PrtnHashInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#gab4d2ba6eeeac98dd13665d92c892a5ac">XilPdi_IsPrtnHashPresent</a> (u32 PrtnNum, u32 HashTableSize)</td></tr>
<tr class="memdesc:gab4d2ba6eeeac98dd13665d92c892a5ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function checks if partition hash is present.  <a href="#gab4d2ba6eeeac98dd13665d92c892a5ac">More...</a><br/></td></tr>
<tr class="separator:gab4d2ba6eeeac98dd13665d92c892a5ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab206394653dbbd10d5fbdbb41832c8e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#gaab206394653dbbd10d5fbdbb41832c8e">XilPdi_ReadImgHdrs</a> (const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr)</td></tr>
<tr class="memdesc:gaab206394653dbbd10d5fbdbb41832c8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads the Image Headers.  <a href="#gaab206394653dbbd10d5fbdbb41832c8e">More...</a><br/></td></tr>
<tr class="separator:gaab206394653dbbd10d5fbdbb41832c8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga34716af70cf4846e312a414d760d9e1b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga34716af70cf4846e312a414d760d9e1b">XilPdi_ReadPrtnHdrs</a> (const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr)</td></tr>
<tr class="memdesc:ga34716af70cf4846e312a414d760d9e1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads the Partition Headers.  <a href="#ga34716af70cf4846e312a414d760d9e1b">More...</a><br/></td></tr>
<tr class="separator:ga34716af70cf4846e312a414d760d9e1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab201600dc6af30b8ca72b6fd0109767c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#gab201600dc6af30b8ca72b6fd0109767c">XilPdi_VerifyPrtnHdrs</a> (const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr)</td></tr>
<tr class="memdesc:gab201600dc6af30b8ca72b6fd0109767c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function verifies Partition Headers.  <a href="#gab201600dc6af30b8ca72b6fd0109767c">More...</a><br/></td></tr>
<tr class="separator:gab201600dc6af30b8ca72b6fd0109767c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3351549fd88876c437726037b8bd5ca3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilpdi__apis.html#ga3351549fd88876c437726037b8bd5ca3">XilPdi_VerifyImgHdrs</a> (const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *MetaHdrPtr)</td></tr>
<tr class="memdesc:ga3351549fd88876c437726037b8bd5ca3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function verifies Image headers.  <a href="#ga3351549fd88876c437726037b8bd5ca3">More...</a><br/></td></tr>
<tr class="separator:ga3351549fd88876c437726037b8bd5ca3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gab4d2ba6eeeac98dd13665d92c892a5ac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_xil_pdi___prtn_hash_info.html">XilPdi_PrtnHashInfo</a>* XilPdi_IsPrtnHashPresent </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>PrtnNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>HashTableSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function checks if partition hash is present. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PrtnNum</td><td>PrtnNum to check partition hash is present or not</td></tr>
    <tr><td class="paramname">HashTableSize</td><td>Size of hash table</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>HashEntry Offset of partition hash to skip authentication.</li>
<li>NULL To authenticate the signature as regular flow. </li>
</ul>
</dd></dl>

<p>References <a class="el" href="xilpdi_8h.html#aed1210cba3367f72a3ae1a0a8d34f981">XIH_PMC_RAM_IHT_OP_DATA_STORE_ADDR</a>.</p>

</div>
</div>
<a class="anchor" id="gab95449e9eb9805839f99e2b4aa107313"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XilPdi_ReadBootHdr </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_xil_pdi___boot_hdr.html">XilPdi_BootHdr</a> **&#160;</td>
          <td class="paramname"><em>BootHdrPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads the boot header. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BootHdrPtr</td><td>is pointer to the address of Boot Header </td></tr>
  </table>
  </dd>
</dl>
<ul>
<li>Copy boot header to local variable from PRAM address </li>
</ul>

<p>References <a class="el" href="xilpdi__plat_8h.html#ad49a1171235ff234ce6053c13c341363">XIH_BH_PRAM_ADDR</a>.</p>

</div>
</div>
<a class="anchor" id="ga06f73224852f1c65b02cbcfae050385b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ReadIhtAndOptionalData </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>PdiType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads IHT and optional data in Image Header Table. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to MetaHeader table.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful read.</li>
<li>XST_FAILURE on unsuccessful copy. </li>
</ul>
</dd></dl>
<p>Clear 2KB PMC RAM which is allocated to store IHT OPTIONAL DATA</p>
<ul>
<li>Read the IHT from Metaheader </li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, <a class="el" href="xilpdi_8h.html#a1d569af531389c06604431461dcd6206">XIH_IHT_LEN</a>, <a class="el" href="xilpdi_8h.html#aed1210cba3367f72a3ae1a0a8d34f981">XIH_PMC_RAM_IHT_OP_DATA_STORE_ADDR</a>, and <a class="el" href="group__xilpdi__apis.html#ga3d9a4d9527cebbe53947e863c88cab1e">XilPdi_ReadOptionalData()</a>.</p>

</div>
</div>
<a class="anchor" id="gaab206394653dbbd10d5fbdbb41832c8e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ReadImgHdrs </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads the Image Headers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to Meta Header</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful read.</li>
<li>XST_FAILURE on unsuccessful read. </li>
</ul>
</dd></dl>
<ul>
<li>Read the Image headers of 64 bytes and update the Image Header structure for all images</li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#af4c05505d849cc9cb018b43c8f848776">XilPdi_MetaHdr::DeviceCopy</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a7aedb1bc8b9897f706301f22ed7a1725">XilPdi_MetaHdr::FlashOfstAddr</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a11507d2e756a50021cb7b1ad8c1560f1">XilPdi_MetaHdr::ImgHdr</a>, <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#aa39dc2024cd839b96cc35bd8911f3b70">XilPdi_ImgHdrTbl::ImgHdrAddr</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, and <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a0bbcb045b71c8d6f86224e4bbd0e58a4">XilPdi_ImgHdrTbl::NoOfImgs</a>.</p>

</div>
</div>
<a class="anchor" id="ga0e8b30c329673e17c9068780d5039b62"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ReadImgHdrTbl </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function Reads the Image Header Table. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to MetaHeader table</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful read.</li>
<li>XST_FAILURE on unsuccessful copy of image header table. </li>
</ul>
</dd></dl>
<ul>
<li>Read the Img header table of 64 bytes and update the Image Header Table structure</li>
<li>Discard or ignore SMAP header when detected in partial PDIs</li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#af4c05505d849cc9cb018b43c8f848776">XilPdi_MetaHdr::DeviceCopy</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a7aedb1bc8b9897f706301f22ed7a1725">XilPdi_MetaHdr::FlashOfstAddr</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#adce12a2a74474eccb3d8cce3040a6ac9">XilPdi_MetaHdr::MetaHdrOfst</a>, <a class="el" href="xilpdi_8h.html#a107d5dada2af10ad48a8c87f60da4fdb">SMAP_BUS_WIDTH_LENGTH</a>, and <a class="el" href="xilpdi_8h.html#a1d569af531389c06604431461dcd6206">XIH_IHT_LEN</a>.</p>

</div>
</div>
<a class="anchor" id="ga3d9a4d9527cebbe53947e863c88cab1e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ReadOptionalData </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>PdiType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads optional data in Image Header Table. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to MetaHeader table. </td></tr>
    <tr><td class="paramname">PdiType</td><td>is PDI type</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful read.</li>
<li>XST_FAILURE on unsuccessful copy. </li>
</ul>
</dd></dl>
<ul>
<li>Read the IHT Optional data from Metaheader</li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#af4c05505d849cc9cb018b43c8f848776">XilPdi_MetaHdr::DeviceCopy</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a7aedb1bc8b9897f706301f22ed7a1725">XilPdi_MetaHdr::FlashOfstAddr</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#adce12a2a74474eccb3d8cce3040a6ac9">XilPdi_MetaHdr::MetaHdrOfst</a>, <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a576c524d2e5b2d8d99621a90d0ead74f">XilPdi_ImgHdrTbl::OptionalDataLen</a>, <a class="el" href="xilpdi_8h.html#a107d5dada2af10ad48a8c87f60da4fdb">SMAP_BUS_WIDTH_LENGTH</a>, <a class="el" href="xilpdi_8h.html#a1d569af531389c06604431461dcd6206">XIH_IHT_LEN</a>, and <a class="el" href="xilpdi_8h.html#a339a46932d4db4aff7ddc1c922b1cf32">XILPDI_OPTIONAL_DATA_MAX_SIZE_16K_BYTES</a>.</p>

<p>Referenced by <a class="el" href="group__xilpdi__apis.html#ga06f73224852f1c65b02cbcfae050385b">XilPdi_ReadIhtAndOptionalData()</a>.</p>

</div>
</div>
<a class="anchor" id="ga34716af70cf4846e312a414d760d9e1b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ReadPrtnHdrs </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads the Partition Headers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to Meta Header</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful read.</li>
<li>XST_FAILURE on unsuccessful read. </li>
</ul>
</dd></dl>
<ul>
<li>Read the Partition headers of 64 bytes and update the Image Header structure for all images</li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#af4c05505d849cc9cb018b43c8f848776">XilPdi_MetaHdr::DeviceCopy</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a7aedb1bc8b9897f706301f22ed7a1725">XilPdi_MetaHdr::FlashOfstAddr</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a305d63ece76563b3e113b38817608210">XilPdi_ImgHdrTbl::NoOfPrtns</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a1e1fdee165b368455fd4a57f2dc9310a">XilPdi_MetaHdr::PrtnHdr</a>, and <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#aaaf8539351352d20a9bbb77265c408a9">XilPdi_ImgHdrTbl::PrtnHdrAddr</a>.</p>

</div>
</div>
<a class="anchor" id="ga99aeeb01dc13465959103fa29625923a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u64 XilPdi_SearchOptionalData </td>
          <td>(</td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>StartAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>EndAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>DataId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function search offset of optional data address. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">StartAddress</td><td>is start address of IHT optional data </td></tr>
    <tr><td class="paramname">EndAddress</td><td>is end address of IHT optional data </td></tr>
    <tr><td class="paramname">DataId</td><td>is to identify type of data in data structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>Offset on getting successful optional data offset address for given data Id. </li>
</ul>
</dd></dl>

<p>Referenced by <a class="el" href="group__xilpdi__apis.html#ga3bac0965e4b613497a5126a4e34feae1">XilPdi_StoreDigestTable()</a>.</p>

</div>
</div>
<a class="anchor" id="ga3bac0965e4b613497a5126a4e34feae1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_StoreDigestTable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function stores digest table for given data Id. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to MetaHeader table.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful read.</li>
<li>XST_FAILURE on unsuccessful copy. </li>
</ul>
</dd></dl>
<pre class="fragment">IHT Optional data format:
-------------------------------------------------------------------------
|    0x00    |            Size (31:16)            |    Data Id (15:0)   |
-------------------------------------------------------------------------
|    0x04    |            Data (Size in words)                          |
-------------------------------------------------------------------------
|    Last    |            Checksum (Sum of previous words in DS)        |
-------------------------------------------------------------------------
DigestTableSize is size of Data except first(0x00) and last word(Last)</pre><p>Verify checksum of data structure info</p>
<p>Copy only data part </p>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#ab03eaa6f8cf7f87eb494327f7243f8ba">XilPdi_MetaHdr::DigestTableSize</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a34b97ff1d32e9192968c2dbe87218e1e">XilPdi_MetaHdr::IsAuthOptimized</a>, <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a576c524d2e5b2d8d99621a90d0ead74f">XilPdi_ImgHdrTbl::OptionalDataLen</a>, <a class="el" href="xilpdi_8h.html#aed1210cba3367f72a3ae1a0a8d34f981">XIH_PMC_RAM_IHT_OP_DATA_STORE_ADDR</a>, <a class="el" href="xilpdi_8h.html#ac7dd901f5a4647ca8a8b5540a6dd421c">XILPDI_OPTIONAL_DATA_WORD_LEN</a>, <a class="el" href="xilpdi_8h.html#acc7c7bce644442453baceece73a280ee">XILPDI_PARTITION_HASH_DATA_ID</a>, <a class="el" href="group__xilpdi__apis.html#ga99aeeb01dc13465959103fa29625923a">XilPdi_SearchOptionalData()</a>, and <a class="el" href="group__xilpdi__apis.html#gacf4b60f3bfd29d0d200e4f218b74dcdf">XilPdi_ValidateChecksum()</a>.</p>

</div>
</div>
<a class="anchor" id="gacf4b60f3bfd29d0d200e4f218b74dcdf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ValidateChecksum </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>Buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to validate the word checksum for the Image Header table and Partition Headers. </p>
<pre class="fragment">            Checksum is based on the below formula
            Checksum = ~(X1 + X2 + X3 + .... + Xn)
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Buffer</td><td>pointer for the data words </td></tr>
    <tr><td class="paramname">Length</td><td>of the buffer for which checksum should be calculated. Last word is taken as expected checksum.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS for successful checksum validation.</li>
<li>XST_FAILURE if checksum validation fails. </li>
</ul>
</dd></dl>
<ul>
<li>Verify the buffer is not empty and has at least 2 values</li>
<li>Calculate the checksum with the below formula Checksum = ~(X1 + X2 + X3 + .... + Xn)</li>
<li>Verify the calculated checksum with the checksum in buffer </li>
</ul>

<p>References <a class="el" href="xilpdi_8h.html#a2aadc896b8c367654a52c3de7d830e43">XILPDI_CHECKSUM_MIN_BUF_LEN</a>, and <a class="el" href="xilpdi_8h.html#a84ae0b3fa3d2f28040e775618d16ce93">XILPDI_INVERT_CHECKSUM</a>.</p>

<p>Referenced by <a class="el" href="group__xilpdi__apis.html#ga3bac0965e4b613497a5126a4e34feae1">XilPdi_StoreDigestTable()</a>, <a class="el" href="group__xilpdi__apis.html#ga797b37ca16b6096549489adff97e5dfc">XilPdi_ValidateImgHdrTbl()</a>, <a class="el" href="group__xilpdi__apis.html#ga3351549fd88876c437726037b8bd5ca3">XilPdi_VerifyImgHdrs()</a>, and <a class="el" href="group__xilpdi__apis.html#gab201600dc6af30b8ca72b6fd0109767c">XilPdi_VerifyPrtnHdrs()</a>.</p>

</div>
</div>
<a class="anchor" id="ga797b37ca16b6096549489adff97e5dfc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ValidateImgHdrTbl </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_xil_pdi___img_hdr_tbl.html">XilPdi_ImgHdrTbl</a> *&#160;</td>
          <td class="paramname"><em>ImgHdrTbl</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function checks the fields of the Image Header Table and validates them. </p>
<p>Image Header Table contains the fields that are common across all the partitions and images.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ImgHdrTbl</td><td>pointer to the Image Header Table</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful Image Header Table validation.</li>
<li>XILPDI_ERR_IHT_CHECKSUM if checksum validation fails.</li>
<li>XILPDI_ERR_NO_OF_IMGS if number of images is less than 0 or more than 32.</li>
<li>XILPDI_ERR_NO_OF_PRTNS if number of partitions is less than 0 or more than 32. </li>
</ul>
</dd></dl>
<ul>
<li>Calculate the checksum of Image Header Table and compare it with the value in Image Header Table</li>
<li>Verify the number of images are greater than zero and less than or equal to 32</li>
<li>Verify the number of partitions are greater than zero and less than or equal to 32</li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a0bbcb045b71c8d6f86224e4bbd0e58a4">XilPdi_ImgHdrTbl::NoOfImgs</a>, <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a305d63ece76563b3e113b38817608210">XilPdi_ImgHdrTbl::NoOfPrtns</a>, <a class="el" href="xilpdi_8h.html#a1d569af531389c06604431461dcd6206">XIH_IHT_LEN</a>, <a class="el" href="xilpdi_8h.html#a7aa874dd9eccde3869f9ca7a99fb96f9">XILPDI_ERR_IHT_CHECKSUM</a>, and <a class="el" href="group__xilpdi__apis.html#gacf4b60f3bfd29d0d200e4f218b74dcdf">XilPdi_ValidateChecksum()</a>.</p>

</div>
</div>
<a class="anchor" id="ga68f9d9d52845d0060f3a12877e54e1cf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_ValidatePrtnHdr </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_xil_pdi___prtn_hdr.html">XilPdi_PrtnHdr</a> *&#160;</td>
          <td class="paramname"><em>PrtnHdr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function validates the Partition Header. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PrtnHdr</td><td>is pointer to Partition Header</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful Partition Header validation.</li>
<li>XILPDI_ERR_ZERO_LENGTH if partition length is 0.</li>
<li>XILPDI_ERR_TOTAL_LENGTH if total length is not matching encoded and unencoded word length.</li>
<li>XILPDI_ERR_PRTN_TYPE if partition type is other than elf, cdo, raw, raw_elf, cfi_gsc and cfi_gsc_unmask. </li>
</ul>
</dd></dl>
<ul>
<li>Verify the partition length is not zero. Otherwise, return XILPDI_ERR_ZERO_LENGTH error.</li>
<li>Verify the total partition length is not less than the encrypted data word and unencrypted data word length. Otherwise, return XILPDI_ERR_TOTAL_LENGTH error.</li>
<li>Verify that the partition type is one of elf, cdo, raw raw_elf, cfi_gsc or cfi_gsc_unmask. Otherwise, return XILPDI_ERR_PRTN_TYPE error.</li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___prtn_hdr.html#a895970f87fc8414aa672ad99914e5b6e">XilPdi_PrtnHdr::EncDataWordLen</a>, <a class="el" href="struct_xil_pdi___prtn_hdr.html#acf49ffc72ab5ba2487058e156c127bbc">XilPdi_PrtnHdr::TotalDataWordLen</a>, <a class="el" href="struct_xil_pdi___prtn_hdr.html#af9e907e03b6e473919d71225e9c01cc3">XilPdi_PrtnHdr::UnEncDataWordLen</a>, and <a class="el" href="xilpdi_8h.html#ad2b34f8a94535a70a9cf14898261181f">XIH_PH_ATTRB_PRTN_TYPE_RSVD</a>.</p>

</div>
</div>
<a class="anchor" id="ga3351549fd88876c437726037b8bd5ca3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_VerifyImgHdrs </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function verifies Image headers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to MetaHeader table.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on successful image validation.</li>
<li>XILPDI_ERR_IH_CHECKSUM on checksum fail. </li>
</ul>
</dd></dl>
<ul>
<li>Verify checksum of all image Headers </li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#a11507d2e756a50021cb7b1ad8c1560f1">XilPdi_MetaHdr::ImgHdr</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a0bbcb045b71c8d6f86224e4bbd0e58a4">XilPdi_ImgHdrTbl::NoOfImgs</a>, and <a class="el" href="group__xilpdi__apis.html#gacf4b60f3bfd29d0d200e4f218b74dcdf">XilPdi_ValidateChecksum()</a>.</p>

</div>
</div>
<a class="anchor" id="gab201600dc6af30b8ca72b6fd0109767c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XilPdi_VerifyPrtnHdrs </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_xil_pdi___meta_hdr.html">XilPdi_MetaHdr</a> *&#160;</td>
          <td class="paramname"><em>MetaHdrPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function verifies Partition Headers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MetaHdrPtr</td><td>is pointer to MetaHeader table</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS on success.</li>
<li>XILPDI_ERR_PH_CHECKSUM on checksum fail. </li>
</ul>
</dd></dl>
<ul>
<li>Verify checksum of all Partition Headers </li>
</ul>

<p>References <a class="el" href="struct_xil_pdi___meta_hdr.html#a8a6314a7d4b3c68b8466d1c2f8fede3b">XilPdi_MetaHdr::ImgHdrTbl</a>, <a class="el" href="struct_xil_pdi___img_hdr_tbl.html#a305d63ece76563b3e113b38817608210">XilPdi_ImgHdrTbl::NoOfPrtns</a>, <a class="el" href="struct_xil_pdi___meta_hdr.html#a1e1fdee165b368455fd4a57f2dc9310a">XilPdi_MetaHdr::PrtnHdr</a>, and <a class="el" href="group__xilpdi__apis.html#gacf4b60f3bfd29d0d200e4f218b74dcdf">XilPdi_ValidateChecksum()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
